SOCKETS.PORT_GET Function

The SOCKETS object is deprecated and may be removed in a future release. Use INET::Socket instead.

Syntax

Port_Number as N = port_get(C flags)

Arguments

Port_Number

The number of the port.

flags

"L" = Local port, "R" = Remote port

Description

Get the port for an open socket. (R = remote port, L = local port)

Discussion

The .PORT_GET() method returns the local or remote port that the socket is connected to.

Example

dim s as P
s = sockets.open("www.alphasoftware.com", 80, "C")
? s.port_get("L") 'local port
= 18700
? s.port_get("R") 'remote port
= 80

See Also